<?php
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="lib/css/main.css" />
<link rel="stylesheet" type="text/css" href="lib/css/drop.css" />
<script type="text/javascript" src="lib/js/main.js"></script>
<script type="text/javascript" src="lib/js/jquery-1.7.1.js"></script>

<style>
div.dash{
margin: 0px;
padding: 0px;
position:absolute;
top:50px;
//height:480px;
height:440px;
width:245px;
overflow:auto;
color:#000000;
font-weight:bold;
font-align:center;
}
</style>
<script type="text/javascript">
function dashFillDiv(stat,divId)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
var url="ajax_dash.php";
url=url+"?stat="+stat;
xmlhttp.onreadystatechange=function (){
  if (xmlhttp.readyState==4)
  {
	document.getElementById(divId).innerHTML = xmlhttp.responseText;
	if(stat=="awarded")
	{		
		dashFillDiv("pullout","dash_pullout");
	}
	if(stat=="pullout")
	{		
		dashFillDiv("pickup","dash_pickup");
	}
	if(stat=="pickup")
	{		
		dashFillDiv("inyard","dash_inyard");
	}
	if(stat=="inyard")
	{
		window.setTimeout('dashFillDiv("awarded","dash_awarded")',10000);
	}
  }
};
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}

function popDetails(id)
{
	xmlhttp_pop=GetXmlHttpObject();
	if (xmlhttp_pop==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  }
	var url="ajax_pop_details.php";
	url=url+"?id="+id;
	xmlhttp_pop.onreadystatechange=function (){
	  if (xmlhttp_pop.readyState==4)
	  {
		parent.disableDiv();
		parent.document.getElementById("pop_div").innerHTML = xmlhttp_pop.responseText;
		parent.showPopDiv();
	  }
	}
	xmlhttp_pop.open("GET",url,true);
	xmlhttp_pop.send(null);	
}

function popIncident(id)
{
	xmlhttp_incident=GetXmlHttpObject();
	if (xmlhttp_incident==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  }
	var url="ajax_pop_incident.php";
	url=url+"?id="+id;
	xmlhttp_incident.onreadystatechange=function (){
	  if (xmlhttp_incident.readyState==4)
	  {
		parent.disableDiv();
		parent.document.getElementById("pop_div").innerHTML = xmlhttp_incident.responseText;
		parent.showPopDiv();
		//$("#myid", top.document); 
		parent.txtToDatePicker();
	  }
	}
	xmlhttp_incident.open("GET",url,true);
	xmlhttp_incident.send(null);	
}

function popStatusLog(cell,truck)
{
	xmlhttp_incident=GetXmlHttpObject();
	if (xmlhttp_incident==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  }
	var url="ajax_pop_status_log.php";
	url=url+"?cell="+cell;
	url=url+"&truck="+truck;
	xmlhttp_incident.onreadystatechange=function (){
	  if (xmlhttp_incident.readyState==4)
	  {
		parent.disableDiv();
		parent.document.getElementById("pop_div").innerHTML = xmlhttp_incident.responseText;
		parent.showPopDiv();
		//$("#myid", top.document); 
		parent.txtToDatePicker();
	  }
	}
	xmlhttp_incident.open("GET",url,true);
	xmlhttp_incident.send(null);	
}
</script>
</head>
<body onLoad='dashFillDiv("awarded","dash_awarded")'>
<!--<h3 style="padding-left:8px;">Dashboard</h3>-->
<table id='title_dash' border='1' width='900' style='margin-left:auto;margin-right:auto;background-color:#5F0C0C;color:white;font-family:Georgia'>
<th>DASHBOARD</th>
</table>
<div id="dash_awarded" class="dash" style="background-color:#FFFFFF; left:10px;">
	
</div>
<div id="dash_pullout" class="dash" style="background-color:#FFFFFF; left:263px;">

</div>
<div id="dash_pickup" class="dash" style="background-color:#FFFFFF; left:516px;">

</div>
<div id="dash_inyard" class="dash" style="background-color:#FFFFFF; left:769px;">

</div>
</body>
</html>

